<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 *      [PinTuXiu] (C)2001-2099 ONightjar.com Pintuxiu.com.
 *      This is NOT a freeware, use is subject to license terms
 */

class mobile_admin_api{

	var $console=array();
	
	public function __construct() {
		$this->pz = &get_instance();
		$this->console = array(
					array('act'=>'setting','label'=>lang('setting','mobile'),'url'=>site_url('admin/load?pm=mobile&act=setting'))
				);
	}
	
	private function param($key,$value=false){
		return $this->pz->param($key,$value);
	}
	
	//lastest category image cat_0.jpg
	
	public function setting(){
		$api = load_api('setting');
		$settingkey = 'mobile';
		$setting = $api->getSetting($settingkey);
		$act=$this->param('evt');
		if($act=='save'){
			$rule_setting = array('thumb_width'=>'1024','thumb_height'=>'768','showarticle'=>'0','quality'=>'0.7','postverify'=>'0');
			foreach ($rule_setting as $key=>$value){
				$setting[$key] = $this->param($key,$value);
			}
			$api->updateSetting($settingkey,$setting);
			$this->pz->redirect(site_url('admin/load?pm=mobile&act=setting'), lang('operate_success','admin'));
			return;
		}
		$this->pz->output("mobile/setting",array('setting'=>$setting));
	}
	
}